home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / demos / signal / winfilt.dem < prev   
Text File  |  1999-09-16  |  1KB  |  32 lines

  1. ////////////////////////
  2. //WINDOWED FIR FILTERS//
  3. ////////////////////////
  4.  
  5. //Low pass filter (length 33, Kaiser window, cut-off .2)
  6.    [wft,wfm,fr]=wfir('lp',33,[.2 0],'kr',[5.6 0]);
  7.    plot2d(fr',log(wfm)')
  8.    xtitle(' ','frequency','magnitude');
  9.    xtitle(['Windowed FIR Low pass Filter';...
  10.           'Kaiser window,cut-off:0.2';...
  11.           'length 33'])
  12.    halt();
  13.          xbasc(); 
  14.  
  15. //Stop band filter (length 127, Hamming window, cut-offs .2 and .3)
  16.    [wft,wfm,fr]=wfir('sb',127,[.2 .3],'hm',[0 0]);
  17.    plot2d(fr',log(wfm)')
  18.    xtitle(' ','frequency','magnitude')
  19.    xtitle(['Windowed FIR Low pass Filter';...
  20.           'Hamming window,cut-off:0.2,0.3';...
  21.           'length 127'])
  22.          xbasc(); 
  23.  
  24. //Band pass filter (length 55, Chebyshev window, cut-offs .15 and .35)
  25.    [wft,wfm,fr]=wfir('bp',55,[.15 .35],'ch',[.001 -1]);
  26.    plot2d(fr',log(wfm)')
  27.    xtitle(' ','frequency','magnitude')
  28.    xtitle(['Windowed FIR Band pass Filter';...
  29.           'Chebyshev window,cut-off:0.15,0.35';...
  30.           'length 55'])
  31.          xbasc(); 
  32.